<template>
	<view class="p20">
		<u-empty v-if="!list.length"></u-empty>
		<view class="mb30" v-for="(item,index) in list" :key="index">
			<view class="flex row-center mb22">
				<view class="pl20 pr20 h48 fs26 color-999 radius50 flex" style="background-color: #f1f1f1;">07-20 18:00
				</view>
			</view>
			<view class="px26 py30 flex radius20 bg-fff"
				@click="$u.route('/pages/public/text',{message_id:item.id,api:'/member/message/messageInfo',tit:item.title})">
				<view class="pr w84 h84">
					<u-avatar src="/static/img/my/xtxx.png" size="84" />
				</view>
				<view class="w-max ml20  ov-h">
					<text>{{item.content}}</text>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				list: ''
			};
		},
		onLoad() {
			this.getList()
		},
		onReachBottom() {
			this.getList('down')
		},
		methods: {
			getList(e) {
				e == 'down' ? this.page++ : this.page = 1
				let params = {
					page: this.page,
				}
				this.$request("/member/message/messageList", params).then(res => {
					let list = res.data.data
					e == 'down' ? this.list.push(...list) : this.list = list
				})
			}
		}
	}
</script>

<style lang="scss">
	page {
		background: #f8f8f8;
	}
</style>
